package com.bw.lib_image

import android.widget.ImageView
import androidx.databinding.BindingAdapter
import com.bumptech.glide.load.resource.bitmap.CircleCrop

object ImageBindingAdapter {

    @JvmStatic
    @BindingAdapter("avatarUrl")
    fun avatarUrl(imageView: ImageView, url: String){
        GlideApp.with(imageView.context)
            .load(url)
            .transform(CircleCrop())
            .placeholder(R.mipmap.icon_default_avatar)
            .error(R.mipmap.icon_default_avatar)
            .into(imageView)
    }
}